﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace ALE_Server.EC
{
    [Serializable]
    [DataContract]
    public class ECReportSpec
    {
        private string m_ReportName;
        private ECReportSetEnum m_ReportSet;
        private ECFilterSpec m_Filter;
        private ECGroupSpec m_Group;
        private ECReportOutputSpec m_Output;
        private bool m_ReportIfEmpty;
        private bool m_ReportOnlyOnChange;

        public ECReportSpec()
        {
        }

        public ECReportSpec(string reportName)
        {
            m_ReportName = reportName;
        }

        public ECReportSpec(string reportName, ECReportSetEnum reportSet)
            : this(reportName)
        {
            m_ReportSet = reportSet;
        }

        [DataMember]
        public string ReportName
        {
            get
            {
                return m_ReportName;
            }
            set
            {
                m_ReportName = value;
            }
        }

        [DataMember]
        public ECReportSetEnum ReportSet
        {
            get
            {
                return m_ReportSet;
            }
            set
            {
                m_ReportSet = value;
            }
        }

        [DataMember]
        public ECReportOutputSpec Output
        {
            get
            {
                return m_Output;
            }
            set
            {
                m_Output = value;
            }
        }

        [DataMember]
        public bool ReportIfEmpty
        {
            get
            {
                return m_ReportIfEmpty;
            }
            set
            {
                m_ReportIfEmpty = value;
            }
        }

        [DataMember]
        public bool ReportOnlyOnChange
        {
            get
            {
                return m_ReportOnlyOnChange;
            }
            set
            {
                m_ReportOnlyOnChange = value;
            }
        }

        [DataMember]
        public ECFilterSpec Filter
        {
            get
            {
                return m_Filter;
            }
            set
            {
                m_Filter = value;
            }
        }

        [DataMember]
        public ECGroupSpec Group
        {
            get
            {
                return m_Group;
            }
            set
            {
                m_Group = value;
            }
        }

        public override string ToString()
        {
            return XmlSerializeHelper.Serialize(this);
        }
    }
}
